package com.qf.service;

import com.qf.bean.Teacher;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

import java.util.List;

/**
 * IntelliJ IDEA -> springdata
 * 2019/11/30 19:38
 *
 * @author zmyao
 * 别看，我是渣渣。
 */
public interface TeacherService {

    Teacher findById(int tid);
    Teacher  insertTeacher(Teacher teacher);
    Teacher updateTeacher(Teacher teacher);
    List<Teacher> findAll();
    //动态查询
    List<Teacher> findByName(String tname);
    List<Teacher> findByTnameContaining(String tname);
    List<Teacher> findByTnameStartingWith(String tname);
    List<Teacher>   findByTnameAndTsex(String tname, String tsex);

    //区间查询
    List<Teacher> findByTids(int begin,int end);
//id大于的范围
List<Teacher> findByTidGreaterThan(int tid);
//IN查询
    List<Teacher> findByTidIn(List<Integer> ids);
   int  countByTnameContaining(String tname);
    List<Teacher> findAll(Sort sort);
    Page<Teacher> findByTidIn(List list, Pageable pageable);
}
